package com.hmis.dao;

import com.hmis.domain.Ward;
import com.hmis.service.WardService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
@Controller
public class WardDAO implements InitializingBean {


    public static WardDAO wardDAO;
    public static WardService wardService;
    @Autowired
    private WardService ward;

    public List<Ward> listWards() {
        return wardService.list();
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        wardService = ward;
        wardDAO = this;
    }

}
